package com.common.model;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Size;

@Data
@TableName(value = "bl_admin")
public class Admin {

    private static final long serialVersionUID = 1L;

    @TableId
    private Long adminId;

    @NotEmpty(message = "用户名不能为空")
    @Size(min = 2, max = 20, message = "用户名长度必须大于2个字小于20个字")
    @ApiModelProperty("用户名")
    private String username;

    @NotEmpty(message = "密码不能为空")
    @ApiModelProperty("密码")
    private String password;

    @Email(message = "不正确的电子邮箱地址")
    @ApiModelProperty("电子邮件地址")
    private String email;

    @ApiModelProperty("头像")
    private String avatar;

    @ApiModelProperty("账号启用状态 [状态:0 => 正常, 1 => 禁用]")
    private Integer status;

    @ApiModelProperty("注册时间")
    private String registerTime;

    @ApiModelProperty("最后登录时间")
    private Integer lastLoginTime;

    @ApiModelProperty("最后登录IP")
    private String lastLoginIp;

    @ApiModelProperty("权限组ID")
    private Integer roleId;

}
